﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Asset/EassetMaster.master" AutoEventWireup="true"
    CodeBehind="CompanyAssetForm.aspx.cs" Inherits="Eassets.UI.Asset.CompanyAssetForm" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/Components/TreeBrowser.ascx" TagName="TreeBrowser" TagPrefix="Tre" %>
<%@ Register Src="~/Components/FlashMessage.ascx" TagName="FlashMessage" TagPrefix="osm" %>
<asp:Content ID="Content3" ContentPlaceHolderID="HeadPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="formtitle">
        <asp:Label ID="labelFormTitle" runat="server" Text="Company Assets"></asp:Label>
    </div>
    <table width="100%" height="5px">
        <tbody>
            <tr>
                <td align="right">
                    <osm:FlashMessage ID="FlashMessage1" runat="server" />
                    &nbsp;&nbsp;&nbsp;
                </td>
            </tr>
        </tbody>
    </table>
    <fieldset>
        <ul class="form">
            <li>
                <div class="formfield">
                    <asp:Label ID="labelMainCategory" runat="server" Text="Main Category" CssClass="legendlabel_size2"></asp:Label>
                    <asp:DropDownList ID="dropDownListMainCategory" runat="server" AutoPostBack="true"
                        CssClass="select" OnSelectedIndexChanged="dropDownListMainCategory_SelectedIndexChanged"
                        AppendDataBoundItems="true">
                        <asp:ListItem Value="" Text="-Select-"></asp:ListItem>
                    </asp:DropDownList>
                </div>
            </li>
        </ul>
        <ul class="form">
            <li>
                <div class="formfield">
                    <asp:Label ID="labelSubCategory" runat="server" Text="Sub Category" CssClass="legendlabel_size2"></asp:Label>
                    <asp:DropDownList ID="dropDownListSubCategory" runat="server" AutoPostBack="true"
                        CssClass="select" OnSelectedIndexChanged="dropDownListSubCategory_SelectedIndexChanged"
                        AppendDataBoundItems="true">
                        <asp:ListItem Value="" Text="-Select-"></asp:ListItem>
                    </asp:DropDownList>
                    <asp:HiddenField ID="hiddenFieldSubCategoryIdAdd" runat="server" />
                </div>
            </li>
        </ul>
        <ul class="form">
            <li>
                <div class="formfield">
                    <asp:Label ID="labelAsset" runat="server" Text="Asset" CssClass="legendlabel_size2"></asp:Label>
                    <asp:DropDownList ID="dropDownListAsset" runat="server" AutoPostBack="true" CssClass="select"
                        OnSelectedIndexChanged="dropDownListAsset_SelectedIndexChanged" AppendDataBoundItems="true">
                        <asp:ListItem Value="" Text="-Select-"></asp:ListItem>
                    </asp:DropDownList>
                </div>
            </li>
        </ul>
    </fieldset>
    <br />
    <fieldset>
        <ul class="form">
            <li>
                <div class="formfield">
                    <asp:GridView ID="gridViewCompanyAssets" runat="server" Caption="Company Assets"
                        CssClass="ColStyle" EmptyDataText="No data to display" AllowPaging="True" PageSize="10"
                        AutoGenerateColumns="false" Width="100%" OnRowDataBound="gridView_RowDataBound" OnPageIndexChanging="gridViewCompanyAssets_PageIndexChanged" OnRowCreated="gridViewCompanyAssets_OnRowCreated">
                        <RowStyle CssClass="RowStyle" />
                        <AlternatingRowStyle CssClass="AltRowStyle" />
                        <HeaderStyle CssClass="GridHeader" />
                        <SelectedRowStyle CssClass="SelectedRowStyle" />
                        <Columns>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <asp:CheckBox runat="server" ID="checkBoxAllSelect" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox runat="server" ID="checkBoxAllSelect" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="CompanyAssetId" HeaderText="" />
                            <asp:BoundField DataField="AssetId" HeaderText="" />
                            <asp:TemplateField HeaderText="Asset Code">
                                <ItemTemplate>
                                    <%# DataBinder.Eval(Container.DataItem, "Asset.Code")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Description">
                                <ItemTemplate>
                                    <%# DataBinder.Eval(Container.DataItem, "Asset.Description")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <%-- <asp:BoundField HeaderText="Asset Code" DataField="Code" ItemStyle-Width="120" />--%>
                            <%-- <asp:BoundField HeaderText="Description" DataField="Description" ItemStyle-Width="140" />--%>
                            <asp:TemplateField HeaderText="Is Depreciable?" ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <table>
                                        <tr>
                                            <td style="text-align: center">
                                                <%--<%# DataBinder.Eval(Container.DataItem, "IsAssetDepreciable")%>--%>
                                                <asp:CheckBox runat="server" ID="checkBoxIsDepriciate" Checked='<%# Convert.ToBoolean(Eval("IsAssetDepreciable")) %>' />
                                            </td>
                                        </tr>
                                    </table>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Life Time">
                                <ItemTemplate>
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:TextBox ID="textBoxLifeTime" runat="server" CssClass="textbox_customsize" Width="40px"
                                                    MaxLength="5" Text='<%# Eval("LifeTime")%>' OnTextChanged="textBoxLifeTime_OnTextChange"></asp:TextBox>
                                                <asp:HiddenField runat="server" ID="hiddenTri1Value" Value="0" />
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="dropDownListLifeTime" runat="server" CssClass="select" AutoPostBack="true">
                                                    <asp:ListItem Value="0" Text="-Select-"></asp:ListItem>
                                                    <asp:ListItem Value="1" Text="Year"></asp:ListItem>
                                                    <asp:ListItem Value="2" Text="Month"></asp:ListItem>
                                                </asp:DropDownList>
                                                <asp:Label ID="LabelHiddenLifeTimeUnitOfMeasure" runat="server" Text='<%# Eval("LifeTimeUnitOfMeasureId")%>'
                                                    Visible="false"></asp:Label>
                                            </td>
                                        </tr>
                                    </table>
                                </ItemTemplate>
                                <%--  <asp:HiddenField runat="server" ID="hiddenTri1Value" Value="0" />--%>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Depreciation Method">
                                <ItemTemplate>
                                    <asp:DropDownList ID="dropDownListDepMethod" runat="server" CssClass="select" AutoPostBack="true">
                                        <asp:ListItem Value="1" Text="Straight-line"></asp:ListItem>
                                        <asp:ListItem Value="2" Text="Reducing balance"></asp:ListItem>
                                    </asp:DropDownList>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Depreciation Rate" ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:Label ID="labelDepreciationRate" runat="server" Text='<%# Eval("DepreciationRate")%>'></asp:Label>
                                            </td>
                                        </tr>
                                    </table>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Residual Value">
                                <ItemTemplate>
                                    <asp:TextBox ID="textBoxResidualValue" runat="server" CssClass="textbox_customsize"
                                        Width="50px" MaxLength="5" Text='<%# Eval("ResidualValue")%>'></asp:TextBox>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <%--  <asp:TemplateField HeaderText="Asset Serial Format" ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:Button ID="ButtonAssetSerialFormat" runat="server" Text="..." CssClass="button_browse" />
                                            </td>
                                        </tr>
                                    </table>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Bar Code Format" ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:Button ID="ButtonBarCodeFormat" runat="server" Text="..." CssClass="button_browse" />
                                            </td>
                                        </tr>
                                    </table>
                                </ItemTemplate>
                            </asp:TemplateField>--%>
                        </Columns>
                    </asp:GridView>
                </div>
            </li>
            <%-- <li>
                <br />
            </li>
            <li></li>--%>
        </ul>
        <br />
        <div class="formfield">
            <ul class="form">
                <li>
                    <div class="formfield">
                        <asp:Button ID="buttonSave" runat="server" Text="Save" CssClass="button_normal" OnClick="buttonSave_Click" />
                    </div>
                </li>
            </ul>
        </div>
    </fieldset>
    <br />
    <%-- <fieldset>
        <ul class="form">
            <li>
                <div class="formfield">
                    <asp:Label ID="labelMainCategoryAll" runat="server" Text="Main Category" CssClass="legendlabel_size2"></asp:Label>
                    <asp:DropDownList ID="dropDownListMainCategoryAll" runat="server" CssClass="select"
                        AutoPostBack="true">
                        <asp:ListItem Value="1" Text="Furniture"></asp:ListItem>
                        <asp:ListItem Value="2" Text="Hardware"></asp:ListItem>
                    </asp:DropDownList>
                </div>
            </li>
        </ul>
        <ul class="form">
            <li>
                <div class="formfield">
                    <asp:Label ID="labelSubCategoryAll" runat="server" Text="Sub Category" CssClass="legendlabel_size2"></asp:Label>
                    <asp:TextBox ID="textBoxSubCategoryAll" runat="server" CssClass="textbox_customsize"
                        Width="100px" MaxLength="8"></asp:TextBox>
                    <asp:Button ID="ButtonSubCategoryAll" runat="server" Text="..." CssClass="button_browse" />
                </div>
            </li>
        </ul>
    </fieldset>--%>
    <br />
    <fieldset>
        <ul class="form">
            <li>
                <div>
                    <asp:GridView ID="gridViewAllAssets" runat="server" Caption="All Assets" CssClass="ColStyle"
                        EmptyDataText="No data to display" AllowPaging="True" PageSize="10" AutoGenerateColumns="false">
                        <RowStyle CssClass="RowStyle" />
                        <AlternatingRowStyle CssClass="AltRowStyle" />
                        <HeaderStyle CssClass="GridHeader" />
                        <SelectedRowStyle CssClass="SelectedRowStyle" />
                        <Columns>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <asp:CheckBox runat="server" ID="checkBoxAllAssets" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox runat="server" ID="checkBoxAssets" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="Asset Id" DataField="AssetId" ItemStyle-Width="250" />
                            <asp:BoundField HeaderText="Asset Code" DataField="Code" ItemStyle-Width="250" />
                            <asp:BoundField HeaderText="Description" DataField="Description" ItemStyle-Width="500" />
                        </Columns>
                    </asp:GridView>
                </div>
            </li>
            <li>
                <div class="formfield">
                    <asp:Button ID="ButtonMap" runat="server" Text="Map" CssClass="button_normal" OnClick="buttonMap_Click" />
                </div>
            </li>
        </ul>
    </fieldset>
    <br />
</asp:Content>
